<?php
// Odbc 
class App_Model {
	protected $_conn;
	
	public function __construct () {
		// Load ini file
        $config = new Zend_Config_Ini(APPLICATION_PATH . '/configs/database.ini', APPLICATION_ENV);
        $registry = Zend_Registry::getInstance();
        $_db = $registry->get('database');

        $baseDeDatos = DATA_PATH . '\\' . $_db->BASE_DE_DATOS . '.accdb';

		try {
            $this->_conn = new PDO('odbc:Driver={Microsoft Access Driver (*.mdb, *.accdb)};Dbq=' . $baseDeDatos,
                $config->user, 
                $config->password
            );
		} catch (Exception $e) {
			echo $e->getMessage();
		}
	}

	public function __destruct () {
		$this->_conn = NULL;
	}
}
